<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Function xrange</title>
<link rel="stylesheet" href="../../../boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Boost.Test">
<link rel="up" href="../../../header/boost/test/data/monomorphic/generators/xrange_hpp.html" title="Header &lt;boost/test/data/monomorphic/generators/xrange.hpp&gt;">
<link rel="prev" href="monomorphic/xrange_t.html" title="Class template xrange_t">
<link rel="next" href="../../../header/boost/test/data/monomorphic/grid_hpp.html" title="Header &lt;boost/test/data/monomorphic/grid.hpp&gt;">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="monomorphic/xrange_t.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../header/boost/test/data/monomorphic/generators/xrange_hpp.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../../../header/boost/test/data/monomorphic/grid_hpp.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.unit_test.data.xrange"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Function xrange</span></h2>
<p>boost::unit_test::data::xrange — Creates a range (sequence) dataset. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../header/boost/test/data/monomorphic/generators/xrange_hpp.html" title="Header &lt;boost/test/data/monomorphic/generators/xrange.hpp&gt;">boost/test/data/monomorphic/generators/xrange.hpp</a>&gt;

</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> SampleType<span class="special">,</span> <span class="keyword">typename</span> Params<span class="special">&gt;</span> 
  <a class="link" href="monomorphic/generated_by.html" title="Class template generated_by">monomorphic::generated_by</a><span class="special">&lt;</span> <a class="link" href="monomorphic/xrange_t.html" title="Class template xrange_t">monomorphic::xrange_t</a><span class="special">&lt;</span> <span class="identifier">SampleType</span> <span class="special">&gt;</span> <span class="special">&gt;</span> 
  <span class="identifier">xrange</span><span class="special">(</span><span class="identifier">Params</span> <span class="keyword">const</span> <span class="special">&amp;</span> params<span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> SampleType<span class="special">&gt;</span> 
  <a class="link" href="monomorphic/generated_by.html" title="Class template generated_by">monomorphic::generated_by</a><span class="special">&lt;</span> <a class="link" href="monomorphic/xrange_t.html" title="Class template xrange_t">monomorphic::xrange_t</a><span class="special">&lt;</span> <span class="identifier">SampleType</span> <span class="special">&gt;</span> <span class="special">&gt;</span> 
  <span class="identifier">xrange</span><span class="special">(</span><span class="identifier">SampleType</span> <span class="keyword">const</span> <span class="special">&amp;</span> end_val<span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> SampleType<span class="special">,</span> <span class="keyword">typename</span> Params<span class="special">&gt;</span> 
  <span class="identifier">enable_if_c</span><span class="special">&lt;</span> <a class="link" href="../../nfp/is_named_param_pack.html" title="Struct template is_named_param_pack">nfp::is_named_param_pack</a><span class="special">&lt;</span> <span class="identifier">Params</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">value</span><span class="special">,</span> <a class="link" href="monomorphic/generated_by.html" title="Class template generated_by">monomorphic::generated_by</a><span class="special">&lt;</span> <a class="link" href="monomorphic/xrange_t.html" title="Class template xrange_t">monomorphic::xrange_t</a><span class="special">&lt;</span> <span class="identifier">SampleType</span> <span class="special">&gt;</span> <span class="special">&gt;</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">type</span> 
  <span class="identifier">xrange</span><span class="special">(</span><span class="identifier">SampleType</span> <span class="keyword">const</span> <span class="special">&amp;</span> end_val<span class="special">,</span> <span class="identifier">Params</span> <span class="keyword">const</span> <span class="special">&amp;</span> params<span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> SampleType<span class="special">&gt;</span> 
  <a class="link" href="monomorphic/generated_by.html" title="Class template generated_by">monomorphic::generated_by</a><span class="special">&lt;</span> <a class="link" href="monomorphic/xrange_t.html" title="Class template xrange_t">monomorphic::xrange_t</a><span class="special">&lt;</span> <span class="identifier">SampleType</span> <span class="special">&gt;</span> <span class="special">&gt;</span> 
  <span class="identifier">xrange</span><span class="special">(</span><span class="identifier">SampleType</span> <span class="keyword">const</span> <span class="special">&amp;</span> begin_val<span class="special">,</span> <span class="identifier">SampleType</span> <span class="keyword">const</span> <span class="special">&amp;</span> end_val<span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> SampleType<span class="special">,</span> <span class="keyword">typename</span> StepType<span class="special">&gt;</span> 
  <a class="link" href="monomorphic/generated_by.html" title="Class template generated_by">monomorphic::generated_by</a><span class="special">&lt;</span> <a class="link" href="monomorphic/xrange_t.html" title="Class template xrange_t">monomorphic::xrange_t</a><span class="special">&lt;</span> <span class="identifier">SampleType</span> <span class="special">&gt;</span> <span class="special">&gt;</span> 
  <span class="identifier">xrange</span><span class="special">(</span><span class="identifier">SampleType</span> <span class="keyword">const</span> <span class="special">&amp;</span> begin_val<span class="special">,</span> <span class="identifier">SampleType</span> <span class="keyword">const</span> <span class="special">&amp;</span> end_val<span class="special">,</span> 
         <span class="identifier">StepType</span> <span class="keyword">const</span> <span class="special">&amp;</span> step_val<span class="special">)</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45283076835312"></a><h2>Description</h2>
<p>The following overloads are available: </p>
<pre class="programlisting"><span class="keyword">auto</span> <span class="identifier">d</span> <span class="special">=</span> <span class="identifier">xrange</span><span class="special">(</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">auto</span> <span class="identifier">d</span> <span class="special">=</span> <span class="identifier">xrange</span><span class="special">(</span><span class="identifier">end_val</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">auto</span> <span class="identifier">d</span> <span class="special">=</span> <span class="identifier">xrange</span><span class="special">(</span><span class="identifier">end_val</span><span class="special">,</span> <span class="identifier">param</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">auto</span> <span class="identifier">d</span> <span class="special">=</span> <span class="identifier">xrange</span><span class="special">(</span><span class="identifier">begin_val</span><span class="special">,</span> <span class="identifier">end_val</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">auto</span> <span class="identifier">d</span> <span class="special">=</span> <span class="identifier">xrange</span><span class="special">(</span><span class="identifier">begin_val</span><span class="special">,</span> <span class="identifier">end_val</span><span class="special">,</span> <span class="identifier">step_val</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">auto</span> <span class="identifier">d</span> <span class="special">=</span> <span class="identifier">xrange</span><span class="special">(</span><span class="identifier">param</span><span class="special">)</span><span class="special">;</span>
</pre>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p><code class="computeroutput">begin_val</code> indicates the start of the sequence (default to 0).</p></li>
<li class="listitem"><p><code class="computeroutput">end_val</code> is the end of the sequence. If ommited, the dataset has infinite size.<br>
</p></li>
<li class="listitem"><p><code class="computeroutput">step_val</code> is the step between two consecutive elements of the sequence, and defaults to 1.<br>
</p></li>
<li class="listitem">
<p><code class="computeroutput">param</code> is the named parameters that describe the sequence. The following parameters are accepted:</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem"><p><code class="computeroutput">begin:</code> same meaning <code class="computeroutput">begin_val</code> </p></li>
<li class="listitem"><p><code class="computeroutput">end:</code> same meaning as <code class="computeroutput">end_val</code> </p></li>
<li class="listitem"><p><code class="computeroutput">step:</code> same meaning as <code class="computeroutput">step_val</code> </p></li>
</ul></div>
<p>
</p>
</li>
</ul></div>
<p>
</p>
<p>The returned value is an object that implements the dataset API.</p>
<div class="note"><table border="0" summary="Note">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../../../../doc/src/images/note.png"></td>
<th align="left">Note</th>
</tr>
<tr><td align="left" valign="top"><p>the step size cannot be null, and it should be positive if <code class="computeroutput">begin_val</code> &lt; <code class="computeroutput">end_val</code>, negative otherwise. </p></td></tr>
</table></div>
<p>
</p>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2001-2020 Boost.Test contributors<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="monomorphic/xrange_t.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../header/boost/test/data/monomorphic/generators/xrange_hpp.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../../../header/boost/test/data/monomorphic/grid_hpp.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
